package cn.iocoder.yudao.module.project.dal.mysql.weighthistoryorderedit;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.project.dal.dataobject.weighthistoryorderedit.WeightHistoryOrderEditDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.project.controller.admin.weighthistoryorderedit.vo.*;

/**
 * 订单编辑-删除相关称重业务 Mapper
 *
 * @author wangzuoyang
 */
@Mapper
public interface WeightHistoryOrderEditMapper extends BaseMapperX<WeightHistoryOrderEditDO> {

    default PageResult<WeightHistoryOrderEditDO> selectPage(WeightHistoryOrderEditPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WeightHistoryOrderEditDO>()
                .eqIfPresent(WeightHistoryOrderEditDO::getWeightId, reqVO.getWeightId())
                .eqIfPresent(WeightHistoryOrderEditDO::getInternalCode, reqVO.getInternalCode())
                .eqIfPresent(WeightHistoryOrderEditDO::getScaleId, reqVO.getScaleId())
                .likeIfPresent(WeightHistoryOrderEditDO::getScaleName, reqVO.getScaleName())
                .eqIfPresent(WeightHistoryOrderEditDO::getIp, reqVO.getIp())
                .eqIfPresent(WeightHistoryOrderEditDO::getPort, reqVO.getPort())
                .eqIfPresent(WeightHistoryOrderEditDO::getWeight, reqVO.getWeight())
                .eqIfPresent(WeightHistoryOrderEditDO::getWeightStatus, reqVO.getWeightStatus())
                .eqIfPresent(WeightHistoryOrderEditDO::getOperator, reqVO.getOperator())
                .betweenIfPresent(WeightHistoryOrderEditDO::getOperatingTime, reqVO.getOperatingTime())
                .eqIfPresent(WeightHistoryOrderEditDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(WeightHistoryOrderEditDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(WeightHistoryOrderEditDO::getRecycleId));
    }

}